<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        var arr2 = ["a", "b", "c", "d", "e", "f"];
        var result2 = arr2.splice(-2);
        console.log("arr2：" + JSON.stringify(arr2));
        console.log("result2：" + JSON.stringify(result2));
    </script>
</body>

</html>